<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>鹭燕药检报告单管理系统</title>

    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link href="__PUBLIC__/admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

    <!-- Morris -->
    <link href="__PUBLIC__/admin/css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">



    <link href="__PUBLIC__/admin/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">








    <script src='__PUBLIC__/admin/assets/daterangepicker/js/jquery.js'></script>
    <!--<script src="https://cdn.bootcss.com/jquery.fileDownload/1.4.2/jquery.fileDownload.js"/>-->
    <script src="__PUBLIC__/admin/js/jquery.js"></script>
    <script src="__PUBLIC__/admin/layer/layer.js"></script>
    <script src="__PUBLIC__/admin/js/dialog.js"></script>
    <!-- basic styles -->

    <link href="__PUBLIC__/admin/assets/css/bootstrap.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/font-awesome.min.css"/>

    <!--[if IE 7]>
    <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/font-awesome-ie7.min.css"/>
    <![endif]-->

    <!-- page specific plugin styles -->

    <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/jquery-ui-1.10.3.full.min.css"/>
    <!--<link rel="stylesheet" href="__PUBLIC__/assets/css/datepicker.css" />-->
    <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ui.jqgrid.css"/>

    <!-- ace styles -->

    <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace.min.css"/>
    <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace-rtl.min.css"/>
    <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace-skins.min.css"/>

    <!--[if lte IE 8]>
    <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace-ie.min.css"/>
    <![endif]-->

    <!--<link rel="stylesheet" href="__PUBLIC__/assets/css/pagination.css" />-->
    <!--日期区间-->
    <!--<link rel="stylesheet" href="__PUBLIC__/assets/daterangepicker/css/bootstrap.css" />-->
    <link rel="stylesheet" href="__PUBLIC__/admin/assets/daterangepicker/css/font-awesome.css"/>
    <link rel="stylesheet" href="__PUBLIC__/admin/assets/daterangepicker/css/daterangepicker.css"/>
    <!--日期区间-->
    <link rel="stylesheet" href="__PUBLIC__/admin/assets/css/datepicker.css"/>

    <!-- inline styles related to this page -->

    <!-- ace settings handler -->

    <script src="__PUBLIC__/admin/assets/js/ace-extra.min.js"></script>

    <!--日期区间-->
    <script src='__PUBLIC__/admin/assets/daterangepicker/js/common.js'></script>
    <script src="__PUBLIC__/admin/assets/daterangepicker/js/date-time/moment.js?ver=1" type="text/javascript"></script>
    <script src="__PUBLIC__/admin/assets/daterangepicker/js/date-time/daterangepicker.zh-CN.js?ver=1"
            type="text/javascript"></script>
    <script src="__PUBLIC__/admin/assets/daterangepicker/js/date-time/daterangepicker.js?ver=1"
            type="text/javascript"></script>
    <!--日期区间-->
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

    <!--[if lt IE 9]>
    <script src="__PUBLIC__/admin/assets/js/html5shiv.js"></script>
    <script src="__PUBLIC__/admin/assets/js/respond.min.js"></script>
    <![endif]-->
</head>

<body>
            <div class="page-content">
                <div class="widget-box">
                    <div class="widget-header">
                        <h6>条件查询</h6>
                        <div class="widget-toolbar">
                            <a href="#" data-action="collapse">
                                <i class="icon-chevron-up"></i>
                            </a>

                            <!--<a href="#" data-action="close">
                                <i class="icon-remove"></i>
                            </a>-->
                        </div>
                    </div>

                    <div class="widget-body">
                        <div class="widget-body-inner" style="display: block;">

                            <div class="widget-main">
                                <form id="querydata" action="doquerydocument" method="post">
                                    <div class="input-group" style="width: 300px;">
										<span class="input-group-addon">
											查询日期
										</span>
                                        <input class="form-control date-picker" id="dateTimeRange" value="" type="text">
										<span class="input-group-addon">
											<i class="fa fa-calendar bigger-110"></i>
										</span>
                                        <input name="beginTime" id="beginTime" value="" type="hidden">
                                        <input name="endTime" id="endTime" value="" type="hidden">
                                        <!--<a href="javascript:;" onclick="begin_end_time_clear();">清除</a>-->
                                    </div>
                                    <hr/>

                                    <div class="row">
                                        <div class="col-sm-3">
                                            <div class="ibox float-e-margins">
                                                <div class="ibox-title">
                                                    <span class="label label-primary pull-right">今日收入</span>
                                                    <!--<h5>收入</h5>-->
                                                </div>
                                                <div class="ibox-content">

                                                    <h1 class="no-margins">{$todaytotalPrice}</h1>
                                                    <empty name="todaytotalPrice"><h1 class="no-margins">0</h1></empty>


                                                    <div class="stat-percent font-bold text-navy">单位（元）<!--44%--> <!--<i class="fa fa-level-up"></i>-->
                                                    </div>
                                                    <small>收入</small>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-3">
                                            <div class="ibox float-e-margins">
                                                <div class="ibox-title">
                                                    <span class="label label-danger pull-right">今日订单</span>
                                                    <!--<h5>订单</h5>-->
                                                </div>
                                                <div class="ibox-content">

                                                    <h1 class="no-margins">{$todayorderNum}</h1>
                                                    <!--<empty name="todayorderNum"> <h1 class="no-margins">0</h1></empty>-->

                                                    <div class="stat-percent font-bold text-danger">单位（单）<!--38%--> <!--<i class="fa fa-level-down"></i>-->
                                                    </div>
                                                    <small>订单</small>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-sm-3">
                                            <div class="ibox float-e-margins">
                                                <div class="ibox-title">
                                                    <span class="label label-info pull-right">全部</span>
                                                    <h5>订单</h5>
                                                </div>
                                                <div class="ibox-content">

                                                    <!-- <h1 class="no-margins">{$orderNum}</h1>-->
                                                    <h1 class="no-margins orderNum">{$orderNum}</h1>
                                                    <empty name="orderNum"> <h1 class="no-margins orderNum">0</h1></empty>

                                                    <div class="stat-percent font-bold text-info">单位（单）<!--20%--> <!--<i class="fa fa-level-up"></i>-->
                                                    </div>
                                                    <small>总订单</small>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-3">
                                            <div class="ibox float-e-margins">
                                                <div class="ibox-title">
                                                    <span class="label label-success pull-right">全部</span>
                                                    <h5>收入</h5>
                                                </div>
                                                <div class="ibox-content">

                                                    <!-- <h1 class="no-margins">{$totalPrice}</h1>-->
                                                    <h1 class="no-margins totalPrice">{$totalPrice}</h1>
                                                    <empty name="totalPrice"><h1 class="no-margins totalPrice">0</h1></empty>

                                                    <div class="stat-percent font-bold text-success">单位（元）<!--98% --><!--<i class="fa fa-bolt"></i>-->
                                                    </div>
                                                    <small>总收入</small>
                                                </div>
                                            </div>
                                        </div>

                                    </div>

                                   <!-- <hr/>-->

                                    <label>订单号</label>
                                    <input id="orderId" name="orderId" type="text"/>
                                    &nbsp;&nbsp;
                                    <label>用户名</label>
                                    <input id="userName" name="userName" type="text"/>
                                    &nbsp;&nbsp;
                                    <label>桌号</label>
                                    <input id="tableNum" name="tableNum" type="text"/>
                                    &nbsp;&nbsp;
                                    <input type="button" value="查询" onclick="querydata();"/>
                                    <input type="button" value="清空" onclick="begin_end_time_clear();"/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->


                        <table id="grid-table"></table>

                        <div id="grid-pager"></div>

                        <script type="text/javascript">
                            var $path_base = "/";//this will be used in gritter alerts containing images
                        </script>

                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->



<!-- basic scripts -->


<!--[if !IE]> -->

<script type="text/javascript">
    window.jQuery || document.write("<script src='__PUBLIC__/admin/assets/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='__PUBLIC__/admin/assets/js/jquery-1.10.2.min.js'>" + "<" + "/script>");
</script>
<![endif]-->

<script type="text/javascript">
    if ("ontouchend" in document) document.write("<script src='__PUBLIC__/admin/assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
</script>
<script src="__PUBLIC__/admin/assets/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/admin/assets/js/typeahead-bs2.min.js"></script>

<!-- page specific plugin scripts -->

<!--<script src="__PUBLIC__/assets/js/date-time/bootstrap-datepicker.min.js"></script>-->
<!--<script src="__PUBLIC__/assets/daterangepicker/js/date-time/bootstrap-timepicker.js"></script>-->
<script src="__PUBLIC__/admin/assets/daterangepicker/js/date-time/bootstrap-datepicker.js"></script>
<script src="__PUBLIC__/admin/assets/daterangepicker/js/date-time/bootstrap-datepicker.zh-CN.js"></script>
<!--<script src="__PUBLIC__/assets/daterangepicker/js/date-time/bootstrap-datetimepicker.js"></script>-->
<!--<script src="__PUBLIC__/assets/daterangepicker/js/date-time/bootstrap-datetimepicker.zh-CN.js"></script>-->

<!--<script src="__PUBLIC__/assets/js/jqGrid/jquery.jqGrid.min.js"></script>-->
<!--<script src="__PUBLIC__/assets/js/jqGrid/i18n/grid.locale-en.js"></script>-->
<!--<script src="__PUBLIC__/assets/js/jqGrid/jquery.jqGrid.minffe4.js"></script>-->
<!--<script src="__PUBLIC__/assets/js/jqGrid/i18n/grid.locale-cnffe4.js"></script>-->
<script src="__PUBLIC__/admin/assets/js/jqGrid/jquery.jqGrid.js"></script>
<script src="__PUBLIC__/admin/assets/js/jqGrid/i18n/grid.locale-cn.js"></script>

<script src="__PUBLIC__/admin/assets/js/jquery.dataTables.min.js"></script>
<script src="__PUBLIC__/admin/assets/js/jquery.dataTables.bootstrap.js"></script>

<!-- ace scripts -->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

<script src="__PUBLIC__/admin/assets/js/ace-elements.min.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace.min.js"></script>

<script type="text/javascript">
    $(function () {
        $('#dateTimeRange').daterangepicker({
                    applyClass: 'btn-sm btn-success',
                    cancelClass: 'btn-sm btn-default',
                    locale: {
                        applyLabel: '确认',
                        cancelLabel: '取消',
                        fromLabel: '起始时间',
                        toLabel: '结束时间',
                        customRangeLabel: '自定义',
                        firstDay: 1
                    },
                    ranges: {
                        //'最近1小时': [moment().subtract('hours',1), moment()],
                        '今日': [moment().startOf('day'), moment()],
                        '昨日': [moment().subtract('days', 1).startOf('day'), moment().subtract('days', 1).endOf('day')],
                        '最近7日': [moment().subtract('days', 6), moment()],
                        '最近30日': [moment().subtract('days', 29), moment()],
                        '本月': [moment().startOf("month"), moment().endOf("month")],
                        '上个月': [moment().subtract(1, "month").startOf("month"), moment().subtract(1, "month").endOf("month")]
                    },
                    opens: 'right',	// 日期选择框的弹出位置
                    separator: ' 至 ',
                    showWeekNumbers: true,		// 是否显示第几周


                    //timePicker: true,
                    //timePickerIncrement : 10,	// 时间的增量，单位为分钟
                    //timePicker12Hour : false,	// 是否使用12小时制来显示时间


                    //maxDate : moment(),			// 最大时间
                    format: 'YYYY-MM-DD'

                }, function (start, end, label) { // 格式化日期显示框
                    $('#beginTime').val(start.format('YYYY-MM-DD'));
                    $('#endTime').val(end.format('YYYY-MM-DD'));
                })
                .next().on('click', function () {
            $(this).prev().focus();
        });
    });

    /**
     * 清除时间
     */
    function begin_end_time_clear() {
        $('#dateTimeRange').val('');
        $('#beginTime').val('');
        $('#endTime').val('');

        $('#orderId').val('');
        $('#userName').val('');
        $('#tableNum').val('');
//        $('#batchNum').val('');
    }

    function querydata() {
        $.post("{:U('incomeAndCountQuery')}",{beginTime:$('#beginTime').val(),endTime:$('#endTime').val()},function(result){
//            alert(result);
       /*     alert(result.totalPrice);
            alert(result.orderNum);*/
          var  obj = JSON.parse(result);;
         /*   alert(obj.totalPrice);
            alert(obj.orderNum);*/
            $(".orderNum").html(obj.orderNum);
            $(".totalPrice").html(obj.totalPrice);

        });


//			alert("1！");
      /*  if ($('#dateTimeRange').val() == "") {
            alert("请输入查询的日期范围！");
        } else {*/
            /*var theGrid = jQuery(grid_selector);
             $(theGrid).jqGrid('setGridParam',{
             postData:{
             'goodsName':$('#goodsName').val(),
             'goodsNum':$('#goodsNum').val(),
             'documentNum':$('#documentNum').val(),
             'batchNum':$('#batchNum').val(),
             'beginTime':$('#beginTime').val(),
             'endTime':$('#endTime').val()
             } //发送数据
             });*/
//			window.location.href="http://localhost:81/luyan/admin.php/Index/showjqgriddata";
//			$("#querydata").submit();


            var grid_selector = "#grid-table";
            jQuery(grid_selector).jqGrid({
                //direction: "rtl",
                mtype: "GET",
                url: "{:U('showjqgriddata')}",
                datatype: "json"
            }).trigger("reloadGrid");


//        }

    }

</script>
<script type="text/javascript">
    jQuery(function ($) {
        var oTable1 = $('#sample-table-2').dataTable({
            "aoColumns": [
                {"bSortable": false},
                null, null, null, null, null,
                {"bSortable": false}
            ]
        });


        $('table th input:checkbox').on('click', function () {
            var that = this;
            $(this).closest('table').find('tr > td:first-child input:checkbox')
                    .each(function () {
                        this.checked = that.checked;
                        $(this).closest('tr').toggleClass('selected');
                    });

        });


        $('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
        function tooltip_placement(context, source) {
            var $source = $(source);
            var $parent = $source.closest('table')
            var off1 = $parent.offset();
            var w1 = $parent.width();

            var off2 = $source.offset();
            var w2 = $source.width();

            if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) return 'right';
            return 'left';
        }
    })

    function preview() {
        alert("preview");
    }

    function down() {
        alert("down");
    }
</script>
<!-- inline scripts related to this page -->

<script type="text/javascript">

    //ajax 方式下载文件操作
    $(document).ready(function () {
//		alert("有鬼》》》");
//		console.log("原来如此");


    });
    jQuery(function ($) {

        var grid_selector = "#grid-table";
        var pager_selector = "#grid-pager";
        //日期选择
        /*datePick = function(elem)
         {
         jQuery(elem).datepicker(
         {
         autoclose: true,
         todayBtn: 'linked',
         language: 'zh-CN',
         dayNamesMin: ['日','一','二','三','四','五','六'],
         onSelect: function(dateText, inst) {

         alert("sss");
         }
         }
         );
         }*/

        jQuery(grid_selector).jqGrid({
            //direction: "rtl",
            mtype: "GET",
            url: "{:U('showjqgriddata')}",
            datatype: "json",
            height: "100%",
            width: "100%",
            //colNames:['序号','单据编号','货主', '交易日期', '货品名称','货品编码','批号','规格型号','产地','生产厂商','内部编号'],
            colNames: ['订单号', '用户名', '联系方式', '价格', '数量', '桌号', '创建时间', '更新时间', '订单状态', '用户检查'],
            colModel: [
                {name: 'order_id', index: 'order_id', width: 30, sorttype: "int",  sortorder :"desc",search: false, hidden: false},
                {name: 'user_name', index: 'user_name', width: 15, sorttype: "int", search: false, key: true},
                {name: 'user_contact', index: 'user_contact', width: 25, searchoptions: {sopt: ['eq']}},
                {name: 'price', index: 'price', width: 25, searchoptions: {sopt: ['eq']}},
                {name: 'item_count', index: 'item_count', width: 25, searchoptions: {sopt: ['eq']}},
                {name: 'table_num', index: 'table_num', width: 25, searchoptions: {sopt: ['eq']}},
//                {name: 'create_time', index: 'create_time', width: 50, search: false},
                /*{name:'create_date', index:'create_date', width:120,align:'center',stype:'text',searchoptions: {dataInit:datePick,attr:{title:'选择日期'}}},//时间类型*/
                {
                    name: 'create_time',
                    index: 'create_time',
                    width: 35,
                    sorttype: "date",
                    stype: 'text',
                    formatter: 'date',
                    sortorder :"desc",
                    formatoptions:{srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s'}
                },
//                {name: 'update_time', index: 'update_time', width: 50, search: false},
                /*{name:'create_date', index:'create_date', width:120,align:'center',stype:'text',searchoptions: {dataInit:datePick,attr:{title:'选择日期'}}},//时间类型*/
                {
                    name: 'update_time',
                    index: 'update_time',
                    width: 30,
                    sorttype: "date",
                    stype: 'text',
                    formatter: 'date',
                    sortorder :"desc",
                    formatoptions:{srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s'}
                },
                {name: 'order_status', index: 'order_status', width: 50, editable: true, formatter: fmatterFuuc},
                {name: 'user_id_check', index: 'user_id_check', width: 30, searchoptions: {sopt: ['eq']}}
            ],
            /*sortable:true,
             sortname: 'TRADEDATE',
             sortorder: 'desc',*/
            viewrecords: true,
            rowNum: 10,
            rowList: [3, 5, 10, 20, 30, 50],
            pager: pager_selector,
            altRows: true,
            gridview: true, //加速显示
            //toppager: true,

//            multiselect: true,
            //multikey: "ctrlKey",
//            multiboxonly: true,

            loadComplete: function () {
                var table = this;
                setTimeout(function () {
                    styleCheckbox(table);

                    updateActionIcons(table);
                    updatePagerIcons(table);
                    enableTooltips(table);
                }, 0);
            },

            editurl: $path_base + "/dummy.html",//nothing is saved
//            caption: "信息列表",
            autowidth: true,
            //%
            beforeRequest: function () {
                var theGrid = jQuery(grid_selector);
                $(theGrid).jqGrid('setGridParam', {
                    postData: {
                        'orderId':   $('#orderId').val(),
                        'userName':  $('#userName').val(),
                        'tableNum':  $('#tableNum').val(),
                        'beginTime': $('#beginTime').val(),
                        'endTime': $('#endTime').val()
                    } //发送数据
                });
            }//&&
        });

        function fmatterFuuc (cellvalue, options, rowObject) {

            if(cellvalue == 0){
                return "未支付";
            }
            if(cellvalue == "1"){
                return "支付成功";
            }
        }

        //switch element when editing inline
        function aceSwitch(cellvalue, options, cell) {
            setTimeout(function () {
                $(cell).find('input[type=checkbox]')
                        .wrap('<label class="inline" />')
                        .addClass('ace ace-switch ace-switch-5')
                        .after('<span class="lbl"></span>');
            }, 0);
        }

        //enable datepicker
        function pickDate(cellvalue, options, cell) {
            setTimeout(function () {
                $(cell).find('input[type=text]')
                        .datepicker({format: 'yyyy-mm-dd', autoclose: true});
            }, 0);
        }

        jQuery.download = function (url, data, method) { // 获得url和data
            if (url && data) {
                // data 是 string 或者 array/object
                data = typeof data == 'string' ? data : jQuery.param(data); // 把参数组装成 form的 input
                var inputs = '';
                jQuery.each(data.split('&'), function () {
                    var pair = this.split('=');
                    inputs += '<input type="hidden" name="' + pair[0] + '" value="' + pair[1] + '" />';
                }); // request发送请求
                jQuery('<form action="' + url + '" method="' + (method || 'post') + '">' + inputs + '</form>').appendTo('body').submit().remove();
            }
            ;
        };

        function downloadFile(url) {
            var elemIF = document.createElement("iframe");
            elemIF.src = url;
            elemIF.style.display = "none";
            document.body.appendChild(elemIF);
        }
        //navButtons
        jQuery(grid_selector).jqGrid('navGrid', pager_selector,
                { 	//navbar options
                    edit: false,
                    editicon: 'icon-pencil blue',
                    add: false,
                    addicon: 'icon-plus-sign purple',
                    del: false,
                    delicon: 'icon-trash red',
                    search: false,
                    searchicon: 'icon-search orange',
                    refresh: true,
                    refreshicon: 'icon-refresh green',
                    view: false,
                    viewicon: 'icon-zoom-in grey',
                    edittext: "编辑",
                    addtext: "添加",
                    searchtext: "查找",
                    deltext: "删除",
                    refreshtext: "刷新"
                }
        );


        /*.searchGrid({multipleSearch:true,closeAfterSearch: true})
         获取jqGrid中选择的行的数据
         如何获取jqGrid中选择的行的数据？
         下面可以获取选择一行的id，如果你选择多行，那下面的id是最后选择的行的id：
         var id=$(‘#gridTable’).jqGrid(‘getGridParam’,'selrow’);
         如果想要获取选择多行的id，那这些id便封装成一个id数组，那可以使用以下：
         var ids=$(‘#gridTable’).jqGrid(‘getGridParam’,'selarrrow’);
         如果想获取选择的行的数据，只要传入rowId即可，如下：
         var rowData = $(“#gridTable”).jqGrid(‘getRowData’,rowId);
         而这个rowData是一个对象，如果要获取选择的行的这个对象的属性值，如name的值，需如下：
         var rowName=rowData.name;
         当然你这个对象得有name这个属性才行。
         应用实例：
         var ids=$("#rightGrid9").jqGrid("getGridParam","selarrrow");
         if(ids.length==1){
         var rowid=$("#rightGrid9").jqGrid("getGridParam","selrow");
         $("#rightGrid9").panGrid("downlayer",{"rowid":rowid});
         }else{
         alert("你没有选取或者选取为多行数据，不允许进入下一级");
         }
         */


        //it causes some flicker when reloading or navigating grid
        //it may be possible to have some custom formatter to do this as the grid is being created to prevent this
        //or go back to default browser checkbox styles for the grid
        function styleCheckbox(table) {
            /**
             $(table).find('input:checkbox').addClass('ace')
             .wrap('<label />')
             .after('<span class="lbl align-top" />')


             $('.ui-jqgrid-labels th[id*="_cb"]:first-child')
             .find('input.cbox[type=checkbox]').addClass('ace')
             .wrap('<label />').after('<span class="lbl align-top" />');
             */
        }


        //unlike navButtons icons, action icons in rows seem to be hard-coded
        //you can change them like this in here if you want
        function updateActionIcons(table) {
            /**
             var replacement =
             {
                 'ui-icon-pencil' : 'icon-pencil blue',
                 'ui-icon-trash' : 'icon-trash red',
                 'ui-icon-disk' : 'icon-ok green',
                 'ui-icon-cancel' : 'icon-remove red'
             };
             $(table).find('.ui-pg-div span.ui-icon').each(function(){
						var icon = $(this);
						var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
						if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
					})
             */
        }

        //replace icons with FontAwesome icons like above
        function updatePagerIcons(table) {
            var replacement =
            {
                'ui-icon-seek-first': 'icon-double-angle-left bigger-140',
                'ui-icon-seek-prev': 'icon-angle-left bigger-140',
                'ui-icon-seek-next': 'icon-angle-right bigger-140',
                'ui-icon-seek-end': 'icon-double-angle-right bigger-140'
            };
            $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function () {
                var icon = $(this);
                var $class = $.trim(icon.attr('class').replace('ui-icon', ''));

                if ($class in replacement) icon.attr('class', 'ui-icon ' + replacement[$class]);
            })
        }

        function enableTooltips(table) {
            $('.navtable .ui-pg-button').tooltip({container: 'body'});
            $(table).find('.ui-pg-div').tooltip({container: 'body'});
        }


        //var selr = jQuery(grid_selector).jqGrid('getGridParam','selrow');


    });
</script>
</body>
</html>
